import curses
from curses import wrapper

def main(stdscr):
    # Clear screen
    stdscr.clear()

    curses.init_pair(1, curses.COLOR_RED, curses.COLOR_GREEN)

    stdscr.addstr(1, 0, "-" * 20)
    stdscr.addstr(2, 0, "support color: {}".format(curses.has_colors()))
    stdscr.addstr(3, 0, "lines: {}, cols: {}".format(curses.LINES, curses.COLS))
    stdscr.addstr(4, 0, "test1", curses.A_REVERSE)
    stdscr.addstr(5, 0, "test2", curses.A_BLINK)
    stdscr.addstr(6, 0, "test3", curses.A_BOLD)
    stdscr.addstr(7, 0, "test4", curses.A_DIM)
    stdscr.addstr(8, 0, "test5", curses.A_STANDOUT)
    stdscr.addstr(9, 0, "test6", curses.A_UNDERLINE)
    stdscr.addstr(10, 0, "test7", curses.color_pair(2))

    stdscr.refresh()
    key = stdscr.getkey()
    print(key)

    # 有点过于底层，决定使用一下 Python Urwid


wrapper(main)
